import akka.actor.AbstractActor
import akka.actor.Props
import akka.cluster.Cluster

class ClusterAkka2 : AbstractActor() {

    private val cluster = Cluster.get(context.system)

    override fun preStart() {
        super.preStart()
    }

    override fun postStop() {
        super.postStop()
    }

    override fun createReceive(): AbstractActor.Receive? {
        return receiveBuilder()
                .match(String::class.java) {
                    println(it)
                }.build()
    }

    companion object {
        fun props(): Props {
            return Props.create(ClusterAkka2::class.java)
        }
    }
}
